<template>
        <a-form-item :label="config.label">
       <a-radio-group v-model="form[config.prop]" @change="onChange">
        <a-radio  :style="radioStyle" v-for="item of config.dataSource" :key="item[config.valueKey]" :value="item[config.labelKey]">
      {{ item[config.labelKey] }}
        </a-radio>
       </a-radio-group>
    </a-form-item>
</template>
<script>
export default {
    name: 'FormRadio',
      props: {
    form: {
      type: Object,
      default: () => ({})
    },
    config: {
      type: Object,
      default: () => ({})
    }
  },
  data(){
    return {
    radioStyle: {
        display: 'block',
        height: '30px',
        lineHeight: '30px',
      },
    }
  },
    methods: {
    onChange() {
      this.$emit('change', this.form[this.config.prop], this.config)
    }
  }
}
</script>
<style scoped>
.ant-radio-wrapper{
    text-align: left;
}
::v-deep .ant-form-item-control{
    text-align: left;
}
</style>